﻿Ext.define('I2R.view.Viewport', {
    extend: 'Ext.Viewport',
    bodyCssClass: 'padding4px',
    layout: 'border',

    initComponent: function () {
        var me = this;

        Ext.applyIf(me, {
            items: [{
                title: '<div id="system-version">' + systemTitle + '<span>' + systemVersion + ' ' + loginName + '</span></div>',
                id: 'header-item',
                cls: 'docs-header',
                region: 'north',
                xtype: 'panel',
                el: 'header',
                border: false,
                margins: '5 5 5 5',
                items: [Ext.create('Ext.Toolbar', {
                    id: 'header_menu',
                    renderTo: this.tbar,
                    items: getMainToolbarButtons()
                })]
            },
            {
                xtype: 'tabpanel',
                id: 'mainTabPanel',
                region: 'center',
                items: [
                    {
                        xtype: 'panel',
                        title: 'Dashboard',
                        renderer: 'html',
                        id: 'tab-dashboard',
                        scope: this,
                        autoScroll: true,
                        loader: {
                            autoLoad: true,
                            url: '/Home/Dashboard',
                            scripts: true,
                            renderer: 'html'
                        }
                    }
                ]
            }
            ]
        });

        me.callParent(arguments);
    },

    renderTo: Ext.getBody()
});

